<?php
require('UserDO.php');
require('userTDG_model.php');
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of UserMapper
 *
 * @author davidsciacchettano
 */
class UserMapper extends DataMapper{
    public static function findAll() {
        $uList = UserTDG_model::findAll();
        
        return $uList;
    }
    
    public static function findById($id) {
        $u = UserTDG_model::findById($id);
        
        return $u;
    }
    
    public static function insert($u) {
        UserTDG_model::insert($u->getName(), $u->getPassword(), $u->getEmail());
    }
    
    public static function update($u) {
        UserTDG_model::update($u->getId(), $u->getVersion(), $u->getName(), 
                $u->getPassword(), $u->getEmail());
    }
    
    public static function delete($u) {
        UserTDG_model::delete($u->getId(), $u->getVersion());
    }
}

?>
